﻿using System.Data;
using System.ServiceModel;
using IToursDataService.Models;

namespace IToursDataService
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的接口名“IBillCtrl”。
    [ServiceContract]
    public interface IBillCtrl
    {
        #region 获取计划收入款项信息
        /// <summary>
        /// 获取对账单数据
        /// </summary>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <returns></returns>
        [OperationContract]
        DataTable GetBillData(string tourgroupId, string loginProviderID);
        #endregion

        #region 计划收入款项信息的增、删、改

        [OperationContract]
        string CreateBillData(BillEntity entity);

        /// <summary>
        /// 更新内容
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [OperationContract]
        int UpdateBillData(BillEntity entity);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="billId"></param>
        /// <returns></returns>
        [OperationContract]
        int DeleteBillData(string billId);
        #endregion

        /// <summary>
        /// 查看导游安排情况，确定地接社是否能够提交“账单”
        /// </summary>
        /// <param name="tourgroupId"></param>
        /// <returns>true可以，false不可以</returns>
        //public bool EnableSubmitExpenseBillDataForGuideArrange(string tourgroupId)
        //{
        //    Database db = DatabaseFactory.CreateDatabase();
        //    DbCommand dbCommand;
        //    string Sql = string.Format(@"SELECT * FROM orgt_TourGroup WHERE TourgroupID='{0}' AND HasGuide=1 AND EXISTS(SELECT * FROM cic_GuideArrange WHERE TourgroupID='{0}')", tourgroupId);
        //    dbCommand = db.GetSqlStringCommand(Sql);
        //    object obj = db.ExecuteScalar(dbCommand);

        //    if (obj != null)//大行程成要求安排导游，且在导游安排计划中也已经安排了导游
        //        return true;
        //    else
        //        return false;
        //}
        /// <summary>
        /// 查看餐厅安排情况，确定地接社是否能够提交“账单”
        /// </summary>
        /// <param name="tourgroupId"></param>
        /// <returns>true可以，false不可以</returns>
        [OperationContract]
        bool EnableSubmitExpenseBillDataForDiningArrange(string tourgroupId);
    }
}
